﻿
namespace SMes.DbMethod.ViewModel
{
    /// <summary>
    /// API设备数据ViewModel
    /// { "Property": "EquipmentStatus","datas":[{"TagName":"001","EquipmentCode": "EQP-001","Tag": 1001, "Value": 123.45 },
    /// {"TagName":"002", "EquipmentCode": "EQP-002", "Tag": 1002, "Value": "运行中"}, ], "UpdateTime": "2025-03-05T10:30:00"}
    /// </summary>
    public class IotDataApiViewModel
    {
        /// <summary>
        /// 特性类型:设备故障EquipmentFault、设备状态EquipmentStatus、设备数据EquipmentData、能耗数据EnergyConsumptionData、工艺数据QualityData、质量数据QualityData、设备参数EquipmentParameter、流转报工数据CirculationReportData
        /// </summary>
        public string Property { get; set; } = null!;
        /// <summary>
        /// 数据
        /// </summary>
        public List<DetailData> datas { get; set; } = [];
        /// <summary>
        ///更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; } = DateTime.Now;
    }
    /// <summary>
    /// 详细数据
    /// </summary>
    public class DetailData
    {
        /// <summary>
        /// 变量唯一标识
        /// </summary>
        public string TagName { get; set; } = null!;
        /// <summary>
        /// 设备编码
        /// </summary>
        public string EquipmentCode { get; set; } = null!;
        /// <summary>
        /// 标签
        /// </summary>
        public int Tag { get; set; } = 0;
        /// <summary>
        /// 值
        /// </summary>
        public object Value { get; set; } = null!;
    }
    /// <summary>
    /// device property
    /// </summary>
    public enum EquipmentProperty
    {
        /// <summary>
        /// 设备故障
        /// </summary>
        EquipmentFault = 10,
        /// <summary>
        /// 设备状态
        /// </summary>
        EquipmentStatus = 20,
        /// <summary>
        /// 设备数据
        /// </summary>
        EquipmentData = 30,
        /// <summary>
        /// 能耗数据
        /// </summary>
        EnergyConsumptionData = 40,
        /// <summary>
        /// 工艺数据
        /// </summary>
        ProcessData = 50,
        /// <summary>
        /// 质量数据
        /// </summary>
        QualityData = 60,
        /// <summary>
        /// 设备参数
        /// </summary>
        EquipmentParameter = 70,
        /// <summary>
        /// 流转报工数据
        /// </summary>
        CirculationReportData = 80
    }
}
